/* 主题变量 */
:root {
    --primary-color: #2250b4;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --nav-bg: #f8f9fa;
    --nav-border: #dee2e6;
    --text-color: #4d4e53;
    --bg-color: #ffffff;
    --border-color: #ddd;
    --hover-bg: #e9ecef;
    --sidebar-width: 300px;
    --sidebar-collapsed-width: 60px;
    /* 折叠后的宽度，保留顶部区域 */
}

[data-theme="dark"] {
    --nav-bg: #2d2d2d;
    --nav-border: #444;
    --text-color: #e9ecef;
    --bg-color: #1a1a1a;
    --border-color: #444;
    --hover-bg: #3d3d3d;
}

/* 基础布局 - 改进的flexbox布局 */
body {
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    /* 确保body级别的滚动条 */
}

.main-container {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: visible;
    /* 不在容器级别限制滚动 */
}

/* 确保所有内容不会产生横向滚动 */
* {
    box-sizing: border-box;
}

body,
html {
    overflow-x: hidden;
}

/* 移除任何可能产生内部滚动条的设置 */
#main {
    overflow-y: visible;
    /* 不在main容器产生滚动条 */
    overflow-x: hidden;
}

/* 右上角操作按钮 */
.top-actions {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 1000;
    background: var(--bg-color);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

/* 导航栏样式 - 修正折叠逻辑 */
nav {
    background-color: var(--nav-bg);
    border-right: 1px solid var(--nav-border);
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    transition: width 0.3s ease;
}

/* 侧边栏折叠状态 - 只收缩宽度，不完全隐藏 */
nav.sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

/* 导航头部 - 始终可见，折叠时调整布局 */
/* 导航头部 - 改进垂直对齐 */
.nav-header {
    padding: 15px;
    border-bottom: 1px solid var(--nav-border);
    background: var(--nav-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 101;
    transition: all 0.3s ease;
    min-height: 60px;
    width: 100%;
    box-sizing: border-box;
    line-height: 32px;
    /* 统一行高控制垂直对齐 */
}

/* Home链接样式 - 统一line-height */
.home-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 32px;
    /* 统一行高 */
    display: flex;
    align-items: center;
    height: 32px;
}

/* 搜索框样式 - 撑满可用空间并统一line-height */
#nav-search {
    flex: 1;
    /* 撑满可用空间 */
    padding: 0 12px;
    /* 移除上下padding，通过line-height控制高度 */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-color);
    min-width: 0;
    height: 32px;
    box-sizing: border-box;
    line-height: 30px;
    /* 减去border的2px，确保文本垂直居中 */
}

#nav-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(34, 80, 180, 0.2);
}

/* 折叠按钮样式 - 统一line-height */
.sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    flex-shrink: 0;
    transition: all 0.3s ease;
    line-height: 32px;
    /* 统一行高 */
}

/* 折叠状态下的导航头部 - 保持垂直对齐 */
nav.sidebar-collapsed .nav-header {
    padding: 15px 8px;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    /* 垂直居中 */
    justify-content: center;
    /* 水平居中 */
}

/* 折叠状态下的Home链接 */
nav.sidebar-collapsed .home-link {
    font-size: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

nav.sidebar-collapsed .home-link::before {
    content: "🏠";
    font-size: 16px;
}

/* 搜索框样式 - 使用更高优先级覆盖jsdoc.css */
nav #nav-search {
    flex: 1 !important;
    /* 强制覆盖固定宽度 */
    width: auto !important;
    /* 覆盖210px固定宽度 */
    padding: 0 12px !important;
    /* 覆盖原有padding */
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    background: var(--bg-color) !important;
    color: var(--text-color) !important;
    min-width: 0 !important;
    height: 32px !important;
    box-sizing: border-box !important;
    line-height: 30px !important;
    /* 减去border的2px */
    margin: 0 !important;
    /* 明确移除任何margin */
    margin-right: 0 !important;
    margin-top: 0 !important;
}

#nav-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(34, 80, 180, 0.2);
}

/* 折叠状态下隐藏搜索框 */
nav.sidebar-collapsed #nav-search {
    display: none;
}

/* 折叠按钮样式 */
.sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--hover-bg);
}

.sidebar-toggle-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

/* 折叠状态下旋转图标 */
nav.sidebar-collapsed .sidebar-toggle-btn svg {
    transform: rotate(180deg);
}

/* 侧边栏内容区域 */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    transition: all 0.3s ease;
}

/* 折叠状态下隐藏侧边栏内容 */
nav.sidebar-collapsed .sidebar-content {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px);
}

/* 侧边栏章节样式 */
.sidebar-section {
    margin-bottom: 0;
}

/* 一级菜单标题样式优化 - 更加突出 */
.sidebar-section-title {
    padding: 15px 15px; /* 增加垂直间距 */
    background: var(--nav-bg);
    border-bottom: 2px solid var(--nav-border); /* 加粗边框 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600; /* 加粗字体 */
    font-size: 15px; /* 增大字体 */
    color: var(--primary-color); /* 使用主色调 */
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
    text-transform: uppercase; /* 大写字母增强视觉效果 */
    letter-spacing: 0.5px; /* 字母间距 */
}

.sidebar-section-title:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    transform: translateX(2px); /* 轻微位移效果 */
}

.sidebar-section-title svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.with-arrow[data-isopen='false'] svg {
    transform: rotate(-90deg);
}

.with-arrow[data-isopen='true'] svg {
    transform: rotate(0deg);
}

/* 章节内容容器 - 优化过渡效果 */
.sidebar-section-children-container {
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    position: relative;
}

/* 二级菜单项样式优化 - 增加间距和视觉层次 */
.sidebar-section-children {
    list-style: none;
    margin: 0;
    padding: 8px 0; /* 增加上下间距 */
    background: rgba(0, 0, 0, 0.02); /* 轻微背景色区分 */
}

/* 确保二级菜单项有足够的空间 */
.sidebar-section-children li {
    border-bottom: 1px solid var(--nav-border);
    margin: 3px 0;
    position: relative;
}

.sidebar-section-children li:last-child {
    border-bottom: none;
}

/* 二级菜单链接样式 */
.sidebar-section-children > li > a {
    display: block;
    padding: 14px 30px; /* 增加垂直间距 */
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500; /* 中等字体权重 */
    transition: all 0.2s ease;
    position: relative;
    line-height: 1.5; /* 增加行高 */
    border-left: 3px solid transparent; /* 左侧指示条 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.sidebar-section-children > li > a:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    padding-left: 32px; /* 悬停时轻微缩进 */
}

/* 当前页面高亮样式 */
.sidebar-section-children > li > a.current {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border-left-color: white;
}

.sidebar-section-children a.current::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: white;
}

/* 折叠状态控制 */
.with-arrow[data-isopen='false']+.sidebar-section-children-container {
    max-height: 0;
}

/* 增加容器的最大高度限制 */
.with-arrow[data-isopen='true']+.sidebar-section-children-container {
    max-height: 5000px; /* 大幅增加最大高度 */
}

/* 方法和成员子列表 */
.sidebar-section-children .methods,
.sidebar-section-children .members {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-section-children .methods li,
.sidebar-section-children .members li {
    border-bottom: none;
}

.sidebar-section-children .methods a,
.sidebar-section-children .members a {
    padding-left: 50px;
    font-size: 13px;
    color: var(--secondary-color);
}

/* 三级菜单样式 - 确保正确的文档流 */
.sidebar-section-children .methods,
.sidebar-section-children .members {
    list-style: none;
    margin: 8px 0 12px 20px;
    padding: 12px 0;
    border-left: 2px solid var(--border-color);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 0 4px 4px 0;
    display: none;
    visibility: hidden;
    position: relative;
    z-index: 2;
    min-height: 0;
    box-sizing: border-box;
}

.sidebar-section-children li.expanded .methods,
.sidebar-section-children li.expanded .members {
    display: block !important;
    visibility: visible;
}

/* 优化三级菜单项的间距和样式 */
.sidebar-section-children .methods li,
.sidebar-section-children .members li {
    margin: 2px 0;
    border-bottom: none;
}

.sidebar-section-children .methods a,
.sidebar-section-children .members a {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-color-secondary);
    border-radius: 0 3px 3px 0;
    transition: background-color 0.15s ease, color 0.15s ease;
    display: block;
    position: relative;
    line-height: 1.4;
}

.sidebar-section-children .methods a:hover,
.sidebar-section-children .members a:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.sidebar-section-children .methods a.current,
.sidebar-section-children .members a.current {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

/* 修复二级菜单点击时的抖动问题和颜色冲突 */
.sidebar-section-children > li > a:active {
    padding: 15px 35px 15px 35px !important;  /* 保持与正常状态一致的padding */
    line-height: 1.5 !important;  /* 保持一致的行高 */
    font-size: inherit !important;  /* 保持字体大小不变 */
    font-family: inherit !important;  /* 保持字体族不变 */
    background: var(--hover-bg) !important;  /* 使用悬停背景色 */
    color: var(--primary-color) !important;  /* 使用主色调文字 */
    border-left-color: var(--primary-color) !important;  /* 左侧指示条颜色 */
}

/* 确保三级菜单的:active状态也不会导致抖动和颜色冲突 */
.sidebar-section-children .methods a:active,
.sidebar-section-children .members a:active {
    padding: 8px 16px !important;  /* 保持与正常状态一致 */
    font-size: 13px !important;
    line-height: inherit !important;
    background-color: var(--hover-bg) !important;  /* 使用悬停背景色 */
    color: var(--primary-color) !important;  /* 使用主色调文字 */
    border-left: 3px solid var(--primary-color) !important;  /* 左侧指示条 */
}

/* 暗夜主题下的:active状态优化 */
[data-theme="dark"] .sidebar-section-children > li > a:active {
    background: var(--hover-bg) !important;  /* 暗夜主题悬停背景 */
    color: var(--primary-color) !important;  /* 确保文字可见 */
}

[data-theme="dark"] .sidebar-section-children .methods a:active,
[data-theme="dark"] .sidebar-section-children .members a:active {
    background-color: var(--hover-bg) !important;  /* 暗夜主题悬停背景 */
    color: var(--primary-color) !important;  /* 确保文字可见 */
}

/* 有子菜单的二级菜单项指示器优化 */
.sidebar-section-children > li > a::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid var(--text-color-secondary);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: all 0.2s ease;
    opacity: 0;
}

/* 显示有子菜单的指示器 */
.sidebar-section-children > li:has(.methods, .members) > a::after {
    opacity: 1;
}

/* 展开状态的指示器 */
.sidebar-section-children > li.expanded > a::after {
    transform: translateY(-50%) rotate(90deg);
    border-left-color: var(--primary-color);
}

/* 主内容区域 - 改进的响应式布局 */
#main {
    margin-left: var(--sidebar-width);
    /* 移除 max-width 限制，让内容完全撑满右侧 */
    width: calc(100vw - var(--sidebar-width));
    padding: 15px 15px;
    transition: margin-left 0.3s ease, width 0.3s ease;
    overflow-x: hidden;
    word-wrap: break-word;
    min-height: calc(100vh - 60px);
    box-sizing: border-box;
}

/* 侧边栏折叠时的主内容区域 */
nav.sidebar-collapsed~#main {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100vw - var(--sidebar-collapsed-width));
}

/* Footer样式修复 - 居中显示并与主体区域保持一致 */
.footer {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: 20px 40px;
    margin-top: 40px;
    text-align: center;
    font-size: 12px;
    color: var(--secondary-color);
    transition: margin-left 0.3s ease, width 0.3s ease;
    box-sizing: border-box;
}

.footer .wrapper {
    max-width: none;
    margin: 0 auto;
    padding: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 侧边栏折叠时的footer样式 */
nav.sidebar-collapsed~.main-container .footer {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100vw - var(--sidebar-collapsed-width));
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .nav-trigger:checked~nav {
        transform: translateX(0);
    }

    #main {
        margin-left: 0;
        padding: 60px 15px 15px 15px;
        width: 100vw;
    }

    .navicon-button {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
    }

    .top-actions {
        top: 15px;
        right: 15px;
    }

    /* 移动端footer样式 - 保持居中 */
    .footer {
        margin-left: 0;
        width: 100vw;
        padding: 15px;
        text-align: center;
    }

    .footer .wrapper {
        white-space: normal;
        /* 小屏幕允许换行 */
        text-align: center;
        /* 保持居中显示 */
    }
}

/* 图标按钮通用样式 */
.icon-button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}

.icon-button:hover {
    background: var(--hover-bg);
}

.icon-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 字体调整弹窗 */
.font-size-tooltip {
    position: fixed;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1001;
    top: 70px;
    right: 15px;
}

.font-size-text {
    min-width: 24px;
    text-align: center;
    font-weight: 500;
    color: var(--text-color);
}

.font-size-tooltip .icon-button {
    width: 28px;
    height: 28px;
}

.font-size-tooltip .icon-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 全局搜索弹窗 */
/* 全局搜索样式 */
#global-search-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    padding-top: 10vh;
}

.global-search-content {
    background: var(--background-color, #fff);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #e1e4e8);
}

#global-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: var(--text-color, #333);
}

#global-search-input::placeholder {
    color: var(--text-muted, #666);
}

#search-close-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    border-radius: 4px;
    color: var(--text-muted, #666);
}

#search-close-button:hover {
    background: var(--hover-background, #f5f5f5);
}

#search-close-button svg {
    width: 20px;
    height: 20px;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.search-result-message {
    padding: 20px;
    text-align: center;
    color: var(--text-muted, #666);
    font-style: italic;
}

.search-result-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-color, #333);
    border-bottom: 1px solid var(--border-light, #f1f3f4);
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--hover-background, #f5f5f5);
    text-decoration: none;
}

.search-result-item:active {
    background-color: var(--active-background, #e8e8e8);
}

.search-result-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.search-result-type-icon {
    margin-right: 8px;
    font-size: 14px;
}

.search-result-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--link-color, #0366d6);
}

.search-result-item-description {
    font-size: 13px;
    color: var(--text-muted, #666);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 深色模式支持 */
[data-theme="dark"] #global-search-container .global-search-content {
    background: var(--background-color, #1a1a1a);
    color: var(--text-color, #e1e4e8);
}

[data-theme="dark"] .search-result-item:hover {
    background-color: #444;
}

[data-theme="dark"] .search-result-item:active {
    background-color: #555;
}

[data-theme="dark"] .search-result-item-title {
    color: var(--link-color, #58a6ff);
}

[data-theme="dark"] #search-close-button:hover {
    background: #444;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #global-search-container {
        padding-top: 5vh;
    }

    .global-search-content {
        width: 95%;
        max-height: 80vh;
    }

    .search-header {
        padding: 12px;
    }

    #global-search-input {
        font-size: 16px;
        /* 防止iOS缩放 */
    }
}

/* 搜索建议 */
.search-suggestions {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--nav-bg);
}

.search-suggestions h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--secondary-color);
    font-weight: 500;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-tag {
    padding: 4px 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 搜索结果 */
.search-results {
    max-height: 50vh;
    overflow-y: auto;
    padding: 0;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background: var(--hover-bg);
}

.search-result-title {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.search-result-description {
    font-size: 14px;
    color: var(--secondary-color);
    line-height: 1.4;
}

.search-result-path {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 5px;
    opacity: 0.8;
}

/* 在现有的 [data-theme="dark"] 规则后添加 */

/* 深色主题 - 主体内容区域 */
[data-theme="dark"] body {
    background-color: #1a1a1a !important;
    color: #e9ecef !important;
}

[data-theme="dark"] section {
    background-color: #1a1a1a !important;
    color: #e9ecef !important;
}

[data-theme="dark"] #main {
    background-color: #1a1a1a !important;
    color: #e9ecef !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #ffffff !important;
}

[data-theme="dark"] h4.name {
    background: #2d4a7a !important;
    color: #ffffff !important;
    border-color: #444 !important;
}

[data-theme="dark"] h4.name a {
    color: #9cc8ff !important;
}

[data-theme="dark"] .details {
    background: #2d2d2d !important;
    border-left-color: #444 !important;
    color: #e9ecef !important;
}

[data-theme="dark"] tt,
[data-theme="dark"] code,
[data-theme="dark"] kbd,
[data-theme="dark"] samp {
    background: #333 !important;
    color: #e9ecef !important;
}

[data-theme="dark"] .prettyprint,
[data-theme="dark"] .prettyprint code {
    background-color: #2d2d2d !important;
    color: #c9d1d9 !important;
}

[data-theme="dark"] .type-signature {
    color: #00918e !important;
}

[data-theme="dark"] .signature-attributes {
    color: #aaa !important;
}

[data-theme="dark"] .ancestors {
    color: #999 !important;
}

[data-theme="dark"] .ancestors a {
    color: #999 !important;
}

[data-theme="dark"] a,
[data-theme="dark"] a:active {
    color: #0bf !important;
}

[data-theme="dark"] article a {
    border-bottom-color: #444 !important;
}

[data-theme="dark"] article a:hover,
[data-theme="dark"] article a:active {
    border-bottom-color: #888 !important;
}

/* 浅色主题 - 确保默认样式 */
[data-theme="light"] body {
    background-color: #ffffff !important;
    color: #4d4e53 !important;
}

[data-theme="light"] section {
    background-color: #ffffff !important;
    color: #4d4e53 !important;
}

[data-theme="light"] #main {
    background-color: #ffffff !important;
    color: #4d4e53 !important;
}

/* 确保section容器的过渡效果 */
.sidebar-section-children-container {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

/* 一级section标题点击效果 */
.sidebar-section-title.with-arrow {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.sidebar-section-title.with-arrow:hover {
    background-color: var(--hover-bg);
}

/* 确保二级菜单项的点击响应 */
.sidebar-section-children>li>a {
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* 三级菜单项的锚点跳转样式 */
.sidebar-section-children .methods a,
.sidebar-section-children .members a {
    cursor: pointer;
}

.sidebar-section-children .methods a:hover,
.sidebar-section-children .members a:hover {
    background-color: var(--hover-bg);
}

/* 搜索模式下的动画效果 */
[data-search-mode] .sidebar-section-children li {
    animation: searchFadeIn 0.2s ease;
}

@keyframes searchFadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 确保展开指示器的正确显示 */
.sidebar-section-children>li:has(.methods, .members)>a::after {
    opacity: 1;
}

.sidebar-section-children>li.expanded>a::after {
    transform: rotate(90deg);
}



/* 搜索模式下确保所有内容可见 */
[data-search-mode] .sidebar-section-children-container {
    max-height: none !important;
    overflow: visible !important;
    transition: none !important;
}

/* 搜索模式下的展开状态 */
[data-search-mode] .sidebar-section {
    display: block !important;
}

[data-search-mode] .sidebar-section-children {
    display: block !important;
}

/* 搜索模式下三级菜单强制显示 */
[data-search-mode] .methods,
[data-search-mode] .members {
    display: block !important;
    visibility: visible !important;
}

/* 搜索高亮样式优化 */
.search-highlight {
    background-color: #ffeb3b;
    color: #000;
    font-weight: bold;
    padding: 1px 2px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

[data-theme="dark"] .search-highlight {
    background-color: #ff9800;
    color: #fff;
}

/* 搜索模式下移除hover效果避免干扰 */
[data-search-mode] .sidebar-section-children a:hover {
    background-color: transparent;
}

/* 搜索结果项的特殊样式 */
[data-search-mode] .sidebar-section-children li[style*="block"] {
    animation: searchResultFadeIn 0.3s ease-in-out;
}

[data-search-mode] .methods li[style*="block"],
[data-search-mode] .members li[style*="block"] {
    animation: searchResultFadeIn 0.3s ease-in-out;
}

@keyframes searchResultFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 确保搜索模式下的层级显示正确 */
[data-search-mode] .sidebar-section-children li {
    position: relative;
}

[data-search-mode] .methods,
[data-search-mode] .members {
    position: relative;
    z-index: 1;
}

/* 深色主题 - 表格样式 */
[data-theme="dark"] .params thead tr,
[data-theme="dark"] .props thead tr {
    background-color: #2d2d2d !important;
}

[data-theme="dark"] .params thead th,
[data-theme="dark"] .props thead th {
    background-color: #2d2d2d !important;
    color: #e9ecef !important;
    border-color: #444 !important;
}

[data-theme="dark"] .params td,
[data-theme="dark"] .props td {
    background-color: #1a1a1a !important;
    color: #e9ecef !important;
    border-color: #444 !important;
}

[data-theme="dark"] .params table,
[data-theme="dark"] .props table {
    background-color: #1a1a1a !important;
    border-color: #444 !important;
}

/* 嵌套表格样式 */
[data-theme="dark"] .params .params table,
[data-theme="dark"] .props .props table {
    background-color: #2d2d2d !important;
    border-color: #444 !important;
}

[data-theme="dark"] .params .params th,
[data-theme="dark"] .params .params td,
[data-theme="dark"] .props .props th,
[data-theme="dark"] .props .props td {
    background-color: #2d2d2d !important;
    color: #e9ecef !important;
    border-color: #444 !important;
}

/* 参数类型样式 */
[data-theme="dark"] span.param-type,
[data-theme="dark"] .params td .param-type {
    color: #0bf !important;
}

/* 表格紧密布局 - 单元格间无空格，只有1px边框 */

.props {
    border-collapse: separate !important;
    border-spacing: 0 !important; /* ✅ 强制设置为0 */
}

.params {
    border-collapse: separate !important;
    border-spacing: 0 !important; /* ✅ 强制设置为0 */
}

.params table {
    border-collapse: separate !important;
    border-spacing: 0 !important; /* ✅ 强制设置为0 */
}



.params table,
.props table {
    border-collapse: separate !important;
    border-spacing: 0 !important; /* ✅ 强制设置为0 */
}

/* 确保所有单元格边框为1px */
.params th,
.params td,
.props th,
.props td {
    border: 1px solid #ddd !important; /* ✅ 强制1px边框 */
}

/* 深色主题下的表格边框 */
[data-theme="dark"] .params th,
[data-theme="dark"] .params td,
[data-theme="dark"] .props th,
[data-theme="dark"] .props td {
    border: 1px solid #444 !important;
}

/* 嵌套表格也使用相同设置 */
.params .params table,
.props .props table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

/* 嵌套表格列宽设置 - 确保优先级 */
.params .params th:nth-child(1),
.params .params td:nth-child(1),
.props .props th:nth-child(1),
.props .props td:nth-child(1) {
    width: 15% !important; /* Name列 */
    min-width: 0;
}

.params .params th:nth-child(2),
.params .params td:nth-child(2),
.props .props th:nth-child(2),
.props .props td:nth-child(2) {
    width: 12% !important; /* Type列 */
    min-width: 0;
}

.params .params th:nth-child(3),
.params .params td:nth-child(3),
.props .props th:nth-child(3),
.props .props td:nth-child(3) {
    width: 13% !important; /* Attributes列 */
    min-width: 0;
}

.params .params th:nth-child(4),
.params .params td:nth-child(4),
.props .props th:nth-child(4),
.props .props td:nth-child(4) {
    width: 10% !important; /* Default列 */
    min-width: 0;
}

.params .params th:nth-child(5),
.params .params td:nth-child(5),
.props .props th:nth-child(5),
.props .props td:nth-child(5) {
    width: 50% !important; /* Description列 - 占50% */
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.5;
}

.params .params th,
.params .params td,
.props .props th,
.props .props td {
    border: 1px solid #ddd !important;
}

[data-theme="dark"] .params .params th,
[data-theme="dark"] .params .params td,
[data-theme="dark"] .props .props th,
[data-theme="dark"] .props .props td {
    border: 1px solid #444 !important;
}